home *** CD-ROM | disk | FTP | other *** search
/ BCI NET / BCI NET Dec 94.iso / archives / programming / c / gcc261ud-c.lha / gnu / os-include / inline / misc.h < prev    next >
C/C++ Source or Header  |  1994-09-22  |  1KB  |  58 lines

  1. #ifndef _INLINE_MISC_H
  2. #define _INLINE_MISC_H
  3.  
  4. #include <sys/cdefs.h>
  5. #include <inline/stubs.h>
  6.  
  7. __BEGIN_DECLS
  8.  
  9. #ifndef BASE_EXT_DECL
  10. #define BASE_EXT_DECL
  11. #define BASE_EXT_DECL0 extern struct Node * MiscBase;
  12. #endif
  13. #ifndef BASE_PAR_DECL
  14. #define BASE_PAR_DECL
  15. #define BASE_PAR_DECL0 void
  16. #endif
  17. #ifndef BASE_NAME
  18. #define BASE_NAME MiscBase
  19. #endif
  20.  
  21. BASE_EXT_DECL0
  22.  
  23. extern __inline UBYTE *
  24. AllocMiscResource (BASE_PAR_DECL unsigned long unitNum,UBYTE *name)
  25. {
  26.   BASE_EXT_DECL
  27.   register UBYTE * _res  __asm("d0");
  28.   register struct Node *a6 __asm("a6") = BASE_NAME;
  29.   register unsigned long d0 __asm("d0") = unitNum;
  30.   register UBYTE *a1 __asm("a1") = name;
  31.   __asm __volatile ("jsr a6@(-0x6)"
  32.   : "=r" (_res)
  33.   : "r" (a6), "r" (d0), "r" (a1)
  34.   : "a0","a1","d0","d1", "memory");
  35.   return _res;
  36. }
  37. extern __inline void 
  38. FreeMiscResource (BASE_PAR_DECL unsigned long unitNum)
  39. {
  40.   BASE_EXT_DECL
  41.   register struct Node *a6 __asm("a6") = BASE_NAME;
  42.   register unsigned long d0 __asm("d0") = unitNum;
  43.   __asm __volatile ("jsr a6@(-0xc)"
  44.   : /* no output */
  45.   : "r" (a6), "r" (d0)
  46.   : "a0","a1","d0","d1", "memory");
  47. }
  48.  
  49. #undef BASE_EXT_DECL
  50. #undef BASE_EXT_DECL0
  51. #undef BASE_PAR_DECL
  52. #undef BASE_PAR_DECL0
  53. #undef BASE_NAME
  54.  
  55. __END_DECLS
  56.  
  57. #endif /* _INLINE_MISC_H */
  58.